<?php
	include("DBConn.php");
	$category = $_POST['category'];
?>
<html>
<body style="background-image:url(pedobear.bmp); background-repeat: no-repeat; background-size: 70%;">
<?php
	$link = connectToDB();
	$strquery = "select ITEM_NAME, QUANTITY, RECENT_QTY_TAKEN, TAKER, DATE_LAST_TAKEN from item_status where CATEGORY='$category';";
	$result = mysql_query($strquery) or die(mysql_error());
	$num = mysql_num_rows($result);
	if($num!=0){
	echo "<center><h1>$category</h1></center>"
	
	?>
		<center>
		<p/>
		
		<table border="1" cellspacing="0" width="60%">
			<tr>
			<?php
			
			while ($field=mysql_fetch_field($result)) {
			echo "<th>";
			echo "<center>$field->name</center>";
			echo "</th>";
			}
			echo "</tr>";

			while ($row = mysql_fetch_row($result)) {
			echo "<tr>";
			for ($i=0; $i<mysql_num_fields($result); $i++) {
			echo "<td>";
			if(($row[$i]!='0000-00-00 00:00:00') || ($row[$i]!=0))
				echo "<center>$row[$i]</center>";
			echo "</td>";
			}
			echo "</tr>\n";
			}

		echo "</table></center>";
		
		}
	mysql_close($link);
	
?>

</body>
</html>